<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr=['貂蝉','烤肉',34,true];

        // 1.for of  获取元素
        for(let item of arr){
            console.log(arr);  
        }

        // 2.for in  获取索引号
        for(let index in arr){
            console.log(index,arr[index]);
        }
    </script>
</body>
</html>